<%include("/common/list-top.html",{title:"计划模板",css:[ctxPath+"/css/plan-template.css",ctxPath+"/ztree/css/metroStyle.css",ctxPath
+ "/zui/dist/lib/datatable/zui.datatable.min.css"]}){} %>

<div class="container-fluid">
	<div class="page-head-nav">
		<div class="row">
			<div class="col-xs-11">
				<ol class="breadcrumb">
					<li><a href="${ctxPath}"><i class="icon icon-home"></i>工作台</a></li>
					<li>项目计划管理</li>
					<li><a href="${ctxPath}/planTemplate">计划模板</a></li>
				</ol>
			</div>
			<div class="col-xs-1">
				<a class="btn btn-link addPlanTemplate" >新增</a>
			</div>
		</div>
	</div>
	<div class="row">
		<!--运输方式数据表格  -->
		<div class="col-xs-12">
			<div class="row listui" id="mainUI">
				<div class="col-xs-12 ">
					<#listTable url="/bartalks/planTemplate"
						fields="plan_template_code,计划模板编码,sort,query|plan_template_name,计划模板名称,sort,query|transportTypeName,运输方式,10%,no-sort,query|startPlaceName,起始地,no-sort,query|destinationName,目的地,no-sort,query|remarks,描述,no-sort,query" />
				</div>
			</div>
		</div>
	</div>
	<!-- 新增 -->
	<div class="modal fade" id="addWindow">
		<div class="modal-dialog modal-lg" >
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">添加计划模板</h4>
				</div>
				<div class="modal-body">
				<form class="form-horizontal" id="addForm">
			    <input type="text" hidden="hidden" name="startPlaceId" id="add_start_place_id" />
			    <input type="text" hidden="hidden" name="DestinationId" id="add_destination_id" />
						<div class="row">
							<div class="col-xs-2">
								<label>模板编码<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="plan_template_code"
									name="planTemplateCode" maxlength="20" placeholder="模板编码"
									readonly="readonly">
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>模板名称<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control" id="plan_template_name"
									name="planTemplateName" maxlength="20" placeholder="模板名称">
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>计划描述<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input class="form-control addRemarks" id="addremarks" name="remarks" placeholder="请简单描述该模版,例:北京到上海计划模版"></input>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>运输方式<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<select class="form-control transportChineseName" id="transport"
									name="transport">
								</select>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>运输地点<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9 table-scroll">
								<table class="table table-bordered queryByPid" id="addtable">
									<thead>
										<tr>
											<th width="8%">序号</th>
											<th>位置</th>
											<th width="12%">到达天数</th>
											<th class="addTableModalbtn"   width="14%">
											增加地点&nbsp;<i class="icon icon icon-plus-sign  addDayIcon" ></i>
											</th>
										</tr>
									</thead>
									<tbody class="Tbody" id="addtbody" >
									</tbody>
								</table>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>起始地<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input id="add_start_place" class="form-control startplace"
									name="startPlaceName" readonly />
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>目的地<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input class="form-control  distination" id="add_distination"
									name="destinationName" readonly />
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>距离(km)</label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control addRemarks"
									name="distance" id="add_distance" />
							</div>
						</div>
						<div class="clearfix"></div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-primary" id="add">保存</button>
			</div>
		</div>
	</div>
	<!-- 编辑 -->
	<div class="modal fade" id="editWindow">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">编辑计划模板</h4>
				</div>
				<div class="modal-body">
					<form class="form-horizontal" id="editForm">
						<input type="text" hidden="hidden" name="id" id="editid" /> 
						<input type="text" hidden="hidden" name="positionCode" id="edit_position_code" />
						<input type="text" hidden="hidden" name="startPlaceId" id="edit_start_place_id" /> 
						<input type="text" hidden="hidden" name="DestinationId" id="edit_destination_id" /> 
						<input type="text" hidden="hidden" name="positionSet" id="edit_positionSet" />
					    	<div class="row">
							<div class="col-xs-2">
								<label>模板编码<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control"
									id="editplanTemplateCode" name="planTemplateCode"
									maxlength="20" placeholder="模板编码" readonly="readonly">
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>模板名称<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control"
									id="editplanTemplateName" name="planTemplateName"
									maxlength="20" placeholder="模板名称">
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>计划描述<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input class="form-control" id="editremarks" name="remarks"placeholder="请简单描述该模板,例:北京到上海计划模版"></input>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>运输方式<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<select class="form-control edittransport" id="edittransport"
									name="transport">
								</select>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>运输地点<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9 table-scroll">
								<table class="table table-bordered queryByPid">
									<thead>
										<tr>
											<th width="8%">序号</th>
											<th>位置</th>
											<th width="12%">到达天数</th>
											<th class="addTableModalbtn"   width="14%">
											增加地点&nbsp;<i class="icon icon icon-plus-sign  addDayIcon" ></i>
											</th>
										</tr>
									</thead>
									<tbody class="Tbody" id="edittbody">
									</tbody>
								</table>
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>起始地<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input id="edit_start_place" class="form-control startplace"
									name="startPlaceName" readonly />
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>目的地<span class="color_red"> *</span></label>
							</div>
							<div class="col-xs-9">
								<input class="form-control distination" id="edit_distination"
									name="destinationName" readonly />
							</div>
						</div>
						<div class="clearfix"></div>
						<div class="row">
							<div class="col-xs-2">
								<label>距离(km)</label>
							</div>
							<div class="col-xs-9">
								<input type="text" class="form-control addRemarks"
									name="distance" id="edit_distance" />
							</div>
						</div>
						<div class="clearfix"></div>
					</form>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
				<button type="button" class="btn btn-primary" id="edit">保存</button>
			</div>
		</div>
	</div>
	<!-- 面板+号按钮对话框 -->
	<div class="modal fade" id="addTableModal">
		<div class="modal-dialog" style="width: 400px">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">×</span><span class="sr-only">关闭</span>
					</button>
					<h4 class="modal-title">请点击下方<i class="iconfont icon-chaxun" style="color: #FF008B;"></i>选择一个位置</h4>
				</div>
				<div class="modal-body">
					<div class="row">
						<div class="col-xs-2">
							<label>位置 </label>
							<input type="text" hidden="hidden" id="addchoosePosition" >
							<input type="text" hidden="hidden" name="positionCode" id="add_position_code" /> 
						</div>
						<div class="col-xs-12">
						<input class="f4tree" data-height="300" customerUrl="/position/tree"  id="edit_destination" />
						</div>
					</div>
					<div class="row">
						<div class="col-xs-2">
							<label for="daynumber">天数</label>
						</div>
						<div class="col-xs-12">
							<div class="input-group">
								<input type="text" class="form-control daynumber"
									id="adddaynumber"> <span class="input-group-addon">
									天 </span>
							</div>
						</div>
					</div>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-primary" id="addDetermine" >确定</button>
					<button type="button" class="btn btn-primary" id="editDetermine" >确定</button>
				</div>
			</div>
		</div>
	</div>
</div>
<%include("/common/list-bottom.html",{js:[ctxPath+"/ztree/js/jquery.ztree.all.min.js",ctxPath
+ "/zui/dist/lib/datatable/zui.datatable.min.js",ctxPath +
"/js/plugin-f4.js", ctxPath +
"/js/plugin-f4tree.js",ctxPath+"/js/planTemplate/planTemplate-list.js"]}){}
%>